import { languages, ExtensionContext } from "vscode"
import { enterKeyEvent } from "./core/enterKeyEvent"
import { provideDefinition } from "./core/provideDefinition"
/**
 * 相应类型文件中自动激活或使用命令激活本插件
 * @param context vscode扩展上下文
 */
export function activate(context: ExtensionContext) {
  // 提供路径跳转程序
  context.subscriptions.push(
    languages.registerDefinitionProvider(
      ["javascript", "javascriptreact", "typescript", "typescriptreact", "vue", "vue-html", "json"],
      {
        provideDefinition
      }
    )
  )
  // 提供路径跳转命令
  context.subscriptions.push(enterKeyEvent)
}
